<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加子节点和移除子节点</title>
</head>
<body>
<div id="div1">
    <p id="p1">这是一段哦</p>
    <p id="p2">这是另一段啦</p>
</div>
<script>
    var pp=document.createElement("p");
    var n=document.createTextNode("这是新的段啦");
    pp.appendChild(n);

    var ee=document.getElementById("div1")
    ee.appendChild(pp);
    var c=document.getElementById("p1");
    ee.removeChild(c);
</script>
</body>
</html>